package com.example.yoho.mvp.view.activity;

import android.content.Intent;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.example.lib_core.mvp.view.BaseActivity;
import com.example.yoho.R;
import com.example.yoho.di.component.DaggerAddCarComponent;
import com.example.yoho.di.moudles.AddCarModules;
import com.example.yoho.mvp.contract.AddCarContract;
import com.example.yoho.mvp.model.entity.AddcarEntity;
import com.example.yoho.mvp.presenter.AddCarPresenter;
import com.flyco.tablayout.CommonTabLayout;

public class GoodsDetailsActivity extends BaseActivity<AddCarPresenter> implements AddCarContract.View, View.OnClickListener {


    private android.widget.LinearLayout ll;
    private android.widget.ImageView back;
    private android.widget.ImageView share;
    private android.widget.ImageView mores;
    private android.widget.ScrollView sv;
    private android.widget.LinearLayout lls;
    private android.widget.LinearLayout gone;
    private android.support.v4.view.ViewPager vp;
    private android.widget.TextView name;
    private android.widget.TextView num;
    private com.flyco.tablayout.CommonTabLayout ctl;
    private android.widget.FrameLayout goBuyFl;
    private android.widget.ImageView makeImg;
    private android.widget.TextView make;
    private android.support.v4.view.ViewPager vpMake;
    private android.widget.TextView number;
    private android.widget.TextView colorss;
    private android.widget.TextView sex;
    private android.widget.TextView sole;
    private android.widget.TextView syr;
    private android.widget.LinearLayout detailsLl;
    private android.support.v7.widget.RecyclerView rv;
    private android.widget.ImageView up;
    private android.widget.ImageView shop;
    private android.widget.LinearLayout jumpStores;
    private android.widget.Button addCar;

    @Override
    public int bondLayout() {
        return R.layout.activity_goods_details;
    }

    @Override
    public void Inject() {
        DaggerAddCarComponent.builder().addCarModules(new AddCarModules(this)).build().Inject(this);
    }

    @Override
    public void initView() {

        findViewById(R.id.back).setOnClickListener(this);
        share = (ImageView) findViewById(R.id.share);
        mores = (ImageView) findViewById(R.id.mores);
        vp = (ViewPager) findViewById(R.id.vp);
        name = (TextView) findViewById(R.id.name);
        num = (TextView) findViewById(R.id.num);
        ctl = (CommonTabLayout) findViewById(R.id.ctl);
        goBuyFl = (FrameLayout) findViewById(R.id.go_buy_fl);
        makeImg = (ImageView) findViewById(R.id.make_img);
        make = (TextView) findViewById(R.id.make);
        vpMake = (ViewPager) findViewById(R.id.vp_make);
        number = (TextView) findViewById(R.id.number);
        colorss = (TextView) findViewById(R.id.colorss);
        sex = (TextView) findViewById(R.id.sex);
        sole = (TextView) findViewById(R.id.sole);
        syr = (TextView) findViewById(R.id.syr);
        detailsLl = (LinearLayout) findViewById(R.id.details_ll);
        rv = (RecyclerView) findViewById(R.id.rv);
        up = (ImageView) findViewById(R.id.up);
        shop = (ImageView) findViewById(R.id.shop);
        findViewById(R.id.jump_stores).setOnClickListener(this);
        findViewById(R.id.add_car).setOnClickListener(this);
    }

    @Override
    public void initData() {

    }

    @Override
    public void showAddCar(AddcarEntity addcarEntity) {
        Toast.makeText(this, "添加成功", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.back:
                this.finish();
                break;
            case R.id.jump_stores:
                Intent store_intent = new Intent(this,StoresActivity.class);
                startActivity(store_intent);
                break;
            case R.id.add_car:
                Intent intent = getIntent();
                mPresenter.AddCar(1,1,"hehe","红色","32","1800","800");
                break;
        }
    }
}
